package com.example.shop_2211.room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy.REPLACE
import androidx.room.Query
import com.example.base.entity.History

@Dao
interface HisDao {
    @Insert(onConflict = REPLACE)
    fun insertHis(history: History)//新增历史搜索记录

    @Delete
    fun deleteHis(history: History)//删除指定历史搜索记录

    @Query("select * from history")
    fun query():List<History>//查询所有历史记录用来展示
}